using System.Text.RegularExpressions;
using System.Windows.Input;

namespace OrbitOne.CRMLyncInfoDashboard.CRM
{
    public class DisplayFieldModel
    {
        public static Regex m_clickablePattern = new Regex(@"^\+?[\d\s\(\)\.]+$|^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$|^(http://|https://)?[a-zA-Z0-9\-\.]+\.(.{2,})$");


        public DisplayFieldModel(string labelText, string fieldName)
        {
            LabelText = labelText;
            FieldName = fieldName;
        }

        public DisplayFieldModel(string labelText, string fieldName, string fieldValue):this(labelText, fieldName)
        {
            FieldValue = fieldValue;
        }

        public string LabelText { get; private set; }
        public string FieldName { get; private set; }
        public string FieldValue { get; set; }
        public Cursor Cursor
        {
            get { return m_clickablePattern.IsMatch(FieldValue) ? Cursors.Hand : Cursors.Arrow; }
        }
    }
}